package A01Function;

import java.util.ArrayList;
import java.util.Arrays;

public class FunctionTest2 {
    public static void main(String[] args) {
        ArrayList<Student> list =new ArrayList<>();
        list.add(new Student("张三",23));
        list.add(new Student("李四",24));
        list.add(new Student("王五",25));

        String[] array = list.stream().map(Student::getName).toArray(String[]::new);
        System.out.println(Arrays.toString(array));

    }
}
